package devcontainer

import (
	"net/http"

	"code.gitea.io/gitea/modules/templates"
	gitea_web_context "code.gitea.io/gitea/services/context"
)

const (
	// TplVscodeHome 显示 DevStar Home 页面 templates/vscode-home.tmpl
	TplVscodeHome templates.TplName = "repo/devcontainer/vscode-home"
)

// VscodeHome 渲染适配于 VSCode 插件的 DevStar Home 页面
func VscodeHome(ctx *gitea_web_context.Context) {
	ctx.Data["Title"] = ctx.Tr("home")
	ctx.Resp.Header().Del("X-Frame-Options")
	//ctx.Resp.Header().Set("Content-Security-Policy", "frame-ancestors *")
	ctx.HTML(http.StatusOK, TplVscodeHome)
}
